#include<bits/stdc++.h>

typedef long long LL;
using namespace std;

int main()
{
	LL ret=0;
	for(LL k=0;k<=2025520;k++)
	{
		LL p = k+(k+1)+(k+2)+(k+3)+(k+4)+(k+5)+(k+6)+(k+7)+(k+8)+(k+9);
		if(p>=20255202){
			cout<<p<<' '<<ret<<endl;
			return 0;
		}
		LL tmp =p%10;
		LL num =p;
		bool flag=false;
		while(num)
		{
			if(num%10!=tmp) break;
			num/=10;
			if(num==0) 
			{
				flag=true;
			}
		}
		if(flag==true)
		{
			ret+=p;
		}
	}
 } 

